$(function () {
    findTop();
})

function findTop() {
    let nav = myAjax(ipAddress()+"/nav/g", {}, "get",false);
    let company = myAjax(ipAddress()+"/company/g", {}, "get",false);
    if (nav != null&& company!=null) {
        setCompanyInfo_head(company.data);

        setNavModels(nav.data);
    }
}

function setCompanyInfo_head(data) {
    let html = '            <div><img src="' + data.logo + '"></div>\n' +
        '            <div>\n' +
        '                <div class="font-title">' + data.name + '</div>\n' +
        '                <div class="font-english">' + data.englishName + '</div>\n' +
        '            </div>\n' +
        '            <div></div>\n' +
        '            <div>做较值得信任的投资服务商</div>';

    $("#companyHead").html(html);
}

function setNavModels(data) {
    let html = '';
    for (let i = 0; i < data.length; i++) {
        html += '<div onclick="window.location.href=\'' + data[i].href + '\'">' + data[i].name + '</div>'
    }
    $("#nav").html(html);
}
